/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gestor;


public class Reputacao {
	private int positiva = 0;
	private int negativa = 0;

	public Reputacao(int positive, int negative) {
		positiva = positive;
		negativa = negative;
	}
	
	public Reputacao(String str) {
		String[] aux = str.split("/-");
		
		try {
			if(aux.length >= 1)
				positiva = Integer.parseInt(aux[0]);
			if(aux.length >= 2)
				negativa = Integer.parseInt(aux[1]);
		}
		catch(NumberFormatException ex)  {
			
		}
	}

	public int getPositive() {
		return positiva;
	}

	public int getNegative() {
		return negativa;
	}

	protected void addPositive() {
		positiva++;
	}

	protected void addNegative() {
		negativa++;
	}

	@Override
	public String toString() {
		return positiva + "/-" + negativa;
	}

}
